package com.cssw.fyzb.core.dao.user;

import com.ydn.dbframe.plugin.activerecord.Db;
import com.ydn.dbframe.plugin.activerecord.Record;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Repository
public class UserAttentionDaoImpl implements UserAttentionDao {

    @Override
    public List<Long> listByUid(Long userId) {
        StringBuffer sql = new StringBuffer();
        sql.append("select * from cmf_user_attention where uid = ? limit 10000");
        List<Record> records = Db.find(sql.toString(), userId);

        List<Long> userIds = new ArrayList<>();
        for (Record record: records){
            userIds.add(record.getLong("touid"));
        }
        return userIds;
    }
}
